<template>
  <a class="link_to_food" @click="getType">
    <img :src="imgUrl">
    <p class="title">{{title}}</p>
  </a>
</template>

<script>
  export default {
    name: "Figure",
    data: function () {
      return {

      }
    },
    props: {
      imgUrl: {
        type: String,
        default: "",
      },
      title: {
        type: String,
        default: "",
      }
    },
    methods: {
      getType() {
        return this.$emit("getType", {})
      }
    }
  }
</script>

<style lang="less" scoped>
  .link_to_food {
    display: block;
    float: left;
    width: 20%;
    padding: 0 5px 0 13px;
    margin-bottom: 30px;
    margin-right: 10px;
    margin-left: 5px;
  }

  .link_to_food img {
    width: 60%;
  }

  .link_to_food p {
    color: #333;
    font-size: 15px;
    margin-top: 20px;
  }
</style>